#ifndef SENDIMG_H
#define SENDIMG_H

#include <QThread>
#include <QQueue>
#include <QMutex>
#include <QWaitCondition>
#include <QImage>

class SendImg : public QObject
{
    Q_OBJECT
public:
    SendImg(QObject *parent = nullptr);
    void pushToQueue(QImage);
    void run();

private:
    QQueue<QByteArray> imgqueue;
    QMutex queue_lock;
    QWaitCondition queue_waitCond;
    QMutex m_lock;
    volatile bool m_isCanrun;

public slots:
    void ImageCapture(QImage);
    void clearImgQueue();
    void stopImmediately();
};

#endif // SENDIMG_H
